const {addWantBuy,getList}=require('../service/wantbuy.server')
class WantBuy{
    async sendWantBuy(ctx){
        console.log("???")
        let data=ctx.request.body
        console.log(data)
        data.send_id=ctx.state.user.id

        const res =await addWantBuy(data)
        ctx.body={
            code:0,
            message:"ok",
            result:res
        }
    }
    async getWantList(ctx){
        const res=await getList()
        ctx.body={
            code:0,
            message: "获得求购列表成功",
            result: res
        }
    }
}


module.exports=new WantBuy()